Returns the upper boundary of an array.
配列のインデックス範囲の最大値を返します。
UBound (ArrayName [, Dimension])
UBound (ArrayName [, Dimension])
Integer
整数
ArrayName: Name of the array for which you want to determine the upper (Ubound) or the lower (LBound) boundary.
ArrayName: インデックス範囲の最大値 (Ubound) ないし最小値 (LBound) を確認する配列の名前。
[Dimension]: Integer that specifies which dimension to return the upper(Ubound) or lower (LBound) boundary for. If no value is specified, the boundary of the first dimension is returned.
[Dimension]: インデックス範囲の最大値 (Ubound) ないし最小値 (LBound) を確認する次元を示す整数値。この値を指定しない場合は、最初の次元のインデックス範囲が返されます。
Sub ExampleUboundLbound
Sub ExampleUboundLbound
Dim sVar(10 to 20) As String
Dim sVar(10 to 20) As String
print LBound(sVar())
print LBound(sVar())
print UBound(sVar())
print UBound(sVar())
end Sub
end Sub
Sub ExampleUboundLbound2
Sub ExampleUboundLbound2
Dim sVar(10 to 20,5 To 70) As String
Dim sVar(10 to 20,5 To 70) As String
Print LBound(sVar()) REM Returns 10
Print LBound(sVar()) REM 戻り値は 10
Print UBound(sVar()) REM Returns 20
UBound(sVar()) REM 戻り値は 20
Print LBound(sVar(),2) REM Returns 5
Print LBound(sVar(),2) REM 戻り値は 5
Print UBound(sVar(),2) REM Returns 70
Print UBound(sVar(),2) REM 戻り値は 70
end Sub
end Sub